home *** CD-ROM | disk | FTP | other *** search
- #include <stdio.h>
- #include <stdlib.h>
- #include <string.h>
- #include <winb.h>
- #include <te.h>
- #include <fntb.h>
- #include <gui.h>
-
- #define INITWAITTIME 20
-
- extern int deskTopId;
- extern int textcommentId[10];
-
- int ban_windowId = -1 ;
- int ban_buttonId = -1 ;
-
- /* initDataMIBAN:ban_windowId:MJ_WINDOWL40の呼び出し関数 */
- int igo_disp(kobj, messId, argc, pev, trigger)
- int kobj ;
- int messId ;
- int argc ;
- EVENT *pev ;
- int trigger ;
- {
- HYPER hyp;
- FRAME org, size;
- int ichi;
- static short int dx, dy;
- static short int shift;
- int b_terr_number, w_terr_number;
-
- if(messId == MM_SHOW){
- disp_init();
- kifu_disp();
- }else if(messId == MM_UPDATE){
- disp_init();
- kifu_disp();
- }else if(messId == MM_ERASE){
- ;
- }else if(messId == MM_MOUSEON){
- if(pev->what == EVMOSDN){
- dx = *((short *)&(pev->info));
- dy = *(((short *)&(pev->info)) + 1);
- shift = pev->shift;
- }
-
- MMI_SendMessage(kobj, MM_GETUSER, 2, &org, &size);
- MMI_SendMessage(kobj, MM_GETHYPER, 1, &hyp);
-
- dx = dx - (hyp.fr.lupx + org.lupx);
- dy = dy - (hyp.fr.lupy + org.lupy);
-
- ichi = disp_chk( dx, dy);
- switch (ichi){
- case -1: /* 盤外の入力*/
- case -2: /* 盤外の入力*/
- break;
- default:
- if(title_judge_read() != 0){
- if(shift & SLEFTBTN){
- kifu_judgeput(ichi, &b_terr_number, &w_terr_number);
- judge_do_set(b_terr_number, w_terr_number);
- judge_ban_disp();
- }
- }else if(mdcheck_input_check(ichi) == 0){
- if(shift & SLEFTBTN){
- if(kifu_put(ichi)==0){
- title_fsave_on();
- }
- }else{
- kifu_cancel();
- }
- comment_dispFunc();
- ban_note_disp();
- }
- break;
- }
-
- }
-
- return NOERR ;
- }
-
- /* initDataMINOTE:note_windowId:MJ_WINDOWL40の呼び出し関数 */
- int igo_oper(kobj, messId, argc, pev, trigger)
- int kobj ;
- int messId ;
- int argc ;
- EVENT *pev ;
- int trigger ;
- {
- static int waittime = INITWAITTIME;
- static short int shift;
- int ret;
-
- if(messId != MM_MOUSEON){
- return NOERR;
- }
-
- do{
- if(pev->what == EVMOSDN){
- shift = pev->shift;
- }
-
- if(shift & SLEFTBTN){
- kifu_forward();
- }else{
- kifu_back();
- }
-
- comment_dispFunc();
- ban_note_disp();
-
- MMI_WaitLoop(waittime);
- waittime *= 0.75;
-
- MMI_iosense();
-
- ret = MMI_GetEvnt(EVMOSUP, &pev);
-
- }while(ret != NOERR);
-
- waittime = INITWAITTIME;
- return NOERR ;
- }
-
- int ban_note_disp()
- {
- WINCTRL *pctrl;
- WINCLIP *pwclp ;
- WINCLIP *pstackVisible ;
- WINCLIP *pstackClip ;
- HYPER hyp ;
- FRAME oFr, sFr, cFr ;
- POINT origin, dspOrigin ;
-
- /* 原点移動 */
- origin.y = origin.x = 0 ;
- MG_PushOrigin(&origin, &dspOrigin) ;
- /* MMI_Openで指定したサイズで設定 */
- MMI_GetControl(&pctrl) ;
- pwclp = WIN_getClipMemory(&pctrl->bound, NULL) ;
- /* WIN_copyClipは省略できない */
- WIN_pushVisible(WIN_copyClip(pwclp), &pstackVisible) ;
- WIN_pushClip(pwclp, &pstackClip) ;
-
- /* ここでMM_SHOWなど描画処理を行う */
- MMI_SendMessage(textcommentId[7], MM_SHOW, 0);
- MMI_SendMessage(textcommentId[9], MM_SHOW, 0);
-
- WIN_popClip(pstackClip) ;
- WIN_popVisible(pstackVisible) ;
- MG_PopOrigin(&dspOrigin) ;
-
-
- /* 原点を ban_windowId のユーザ領域の左上に移動 */
- MMI_SendMessage(ban_windowId, MM_GETHYPER, 1, &hyp) ;
- MMI_SendMessage(ban_windowId, MM_GETUSER, 2, &oFr, &sFr) ;
- cFr.lupx = dspOrigin.x = hyp.fr.lupx + oFr.lupx ;
- cFr.lupy = dspOrigin.y = hyp.fr.lupy + oFr.lupy ;
- cFr.rdwx = cFr.lupx + oFr.rdwx -1 ;
- cFr.rdwy = cFr.lupy + oFr.rdwy -1 ;
- MG_PushOrigin(&dspOrigin, &origin) ;
- pwclp = WIN_getClipMemory(&cFr, NULL) ;
- /* WIN_copyClipでクリップのコピーをビジブルの設定に利用する */
-
- WIN_pushVisible(WIN_copyClip(pwclp), &pstackVisible) ;
- WIN_pushClip(pwclp, &pstackClip) ;
- /* ここでWGB 関数などを使用して描画 */
- kifu_disp();
- WIN_popClip(pstackClip) ;
- WIN_popVisible(pstackVisible) ;
- /* 原点を元に戻す */
- MG_PopOrigin(&origin) ;
-
- return NOERR;
- }